Skip to content

feat: surface gamma_flip_status and handle null gamma_flip - #2

Merged
tomaszdobrowolski1 merged 2 commits into
mainfrom
feat/gamma-flip-status
Sep 9, 2026
Merged

feat: surface gamma_flip_status and handle null gamma_flip#2
tomaszdobrowolski1 merged 2 commits into
mainfrom
feat/gamma-flip-status

Conversation

@tomaszdobrowolski1

Copy link
Copy Markdown
Contributor

Adds the gamma_flip_status field to every response model that carries a gamma flip, and fixes null-handling bugs the change exposes.

Why

The FlashAlpha API (endpoint version 2026.09.09, deployed 2026-09-09) now publishes gamma_flip only when the option book supports it. Roughly two chains in three return gamma_flip: null with regime: "unknown". A new sibling field gamma_flip_status says why: available, or a reason code such as sensitive_root, insufficient_quote_quality, insufficient_local_coverage, no_boundary, stored_sign_mismatch, uncertain_root_path, search_budget, quality_budget.

Statically-typed SDKs bind only declared members, so before this change the field was silently dropped and callers had no way to learn why a level was withheld.

Field naming

The API uses two value-field names but only one status name:

Value field Status field Endpoints
gamma_flip gamma_flip_status 18
live_gamma_flip gamma_flip_status 3 (flow levels / gex / live)

Note the asymmetry: the status is not named live_gamma_flip_status. This was verified by sweeping 23 production endpoints for every key containing gamma_flip; exactly three names exist.

Typed as a plain nullable string, never an enum, so a future reason code cannot break deserialization. Callers should treat any unrecognised value as unavailable.

Verification

Every value field in this repo is paired 1:1 with a status field, checked by counting serializer-bound declarations only. Build and tests are green.

Not included

No version bump and no registry publish. Existing integration tests that assert a non-null flip are left untouched; they encode the old contract and need a separate decision.

🤖 Generated with Claude Code

tdobrowolski1 and others added 2 commits September 9, 2026 18:00
The API (endpoint version 2026.09.09) made gamma_flip nullable and added a
sibling gamma_flip_status string that reads "available" when a level is
published and otherwise carries a reason code (no_boundary,
stored_sign_mismatch, insufficient_local_coverage, insufficient_quote_quality,
sensitive_root, uncertain_root_path, search_budget, quality_budget). Roughly
two in three chains now return a null flip, with regime falling back to
"unknown". This adds gamma_flip_status alongside every gamma_flip declaration
in the response types and fixes the quickstart example, which formatted the
level with :.2f and therefore raised TypeError on NoneType.__format__ for the
now-common null case; it prints the reason code instead. The README quick start
is updated to match, since it is rendered on PyPI. Clients should treat any
status other than "available", including codes added later, as no level
published.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The three flow endpoints (/v1/flow/levels, /v1/flow/gex, /v1/flow/live) pair
their value field live_gamma_flip with a status field named plainly
gamma_flip_status, not live_gamma_flip_status, so searching only for the
gamma_flip identifier missed them and FlowLevelsResponse, FlowGexResponse and
FlowLiveResponse were dropping a field the API actually returns. This adds the
declaration to all three, noting the asymmetric wire name at each site, which
brings the package to fourteen gamma_flip_status declarations. It also brings
the reference docs in line: docs/api.md gains the field in thirteen JSON
examples, five response-field tables and three notable-metrics lists, marks
gamma_flip nullable where it was not already, and carries a callout explaining
the reason codes and the flow naming asymmetry; AGENTS.md gains an entry in its
silent-null traps list warning that formatting gamma_flip as a number raises
TypeError; llms.txt gains a nullability note beside its typed-response example.
article-flashalpha-python-sdk.md is left alone as marketing prose rather than a
field reference, and its snippets do not format the level numerically.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tomaszdobrowolski1
tomaszdobrowolski1 merged commit 747335f into main Sep 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants